package com.icss.web.back.controller;

import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.icss.common.controller.BaseController;
import com.icss.common.util.ConstatFinalUtil;
import com.icss.common.util.PageInfoUtil;
import com.icss.common.vo.ApiResponse;
import com.icss.orders.service.IOrdersOperService;

/**
 * 	模板示例代码操作
 * 	@author 刘鑫
 */
@Controller
@RequestMapping("/back/stat/")
public class StatBackController extends BaseController
{
	@Resource
	private IOrdersOperService ordersOperService;
	
	/*====订单表开始====*/
	/**
	 * 订单列表页面
	 * @return
	 */
	@RequestMapping("/ordersList")
	public String ordersList(HttpServletRequest request,Model model)
	{
		ConstatFinalUtil.SYS_LOGGER.info("--dynastyList--");
		/* 分页信息 */
		PageInfoUtil pageInfoUtil = this.proccedPageInfo(request);
		/* 搜索条件,生成公共的搜索条件 */
		Map<String, Object> condMap = this.proccedSearch(request);
		String statType = request.getParameter("statType");
		if(statType == null)
		{
			statType = "" ;
		}
		condMap.put("statType", statType);
		request.setAttribute("statType", statType);
		/* 查询数据库
		 * 所有的数据以JSON的形式返回
		 *  */
		ApiResponse<Map<String, Object>> apiResponse = this.ordersOperService.findStatOrdersListMapService(pageInfoUtil, condMap);
		/* 将结果存储到Request中 */
		request.setAttribute("response", apiResponse.toJSON());
		return "/back/stat/ordersList";
	}
	/*====订单表结束====*/
}
